import { ResPage, Exam, ResultData } from "@/api/interface/index";
import http from "@/api";

/**
 * @name 考试管理模块
 */
// 获取考试列表
export const getExamList = (params: Exam.ReqExamInfoParams) => {
  return http.post<ResPage<Exam.ResExamInfoList>>(`/electcollect/trainTest/query`, params);
};
// 获取考试详情
export const getExamDtl = (params: { testId: number }) => {
  return http.post<ResultData>(`/exam/question/detail`, params);
};
// 新增考试
export const addExam = (params = {}) => {
  return http.post(`/electcollect/trainTest/add`, params);
};
// 编辑考试
export const editExam = (params: { testId: number }) => {
  return http.post(`/electcollect/trainTest/modify`, params);
};

// 删除考试
export const deleteExam = (params: { deviceList: { deviceId: string }[] }) => {
  return http.post(`/electcollect/trainTest/remove`, params);
};
